﻿using MeetAI.Model;
using MeetAI.Model.VO;
using MeetAI.Repository.IRepository;
using MeetAI.Service.IService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace MeetAI.Service
{
    public class Dy_Ads_Service : BaseService<dy_ads>, IDy_Ads_Service
    {
        private readonly IDy_Ads_Repository _repository;
        public Dy_Ads_Service(IDy_Ads_Repository repository) : base(repository)
        {
            _repository = repository;
        }
        public async Task<IEnumerable<dy_ads_vo>> getAds(Expression<Func<dy_ads, bool>> exp)
        {
            var lst = await _repository.FindListByClauseAsync(exp);
            return lst.Select(s => new dy_ads_vo
            {
                adfile = string.Format("{0}{1}", staticDomain, s.adfile),
                gourl = s.gourl
            });
        }
    }
}
